<template>
  <div class="account-on-sale-page">
    <Back-top></Back-top>
    <Nav active-name="account-on-sale"/>
    <div class="breadcrumb-holder flex-row-v-center">
      <div class="item">首页</div>
      <img class="arrow" src="~assets/img/icon-right-arrow.png" />
      <div class="item active">在售账号</div>
    </div>

    <div class="sec-01">
      <div class="item" v-for="item in gameList" :key="item.id" @click="goToNewPage(item.url)">
        <img :src="item.img" :alt="item.name" />
        <div class="name">{{ item.name }}</div>
      </div>
    </div>
  </div>
</template>

<script>
import Core from "~/core/core";

export default {
  data() {
    return {
      gameList: []
    }
  },
  mounted() {
    setTimeout(() => {
      this.gameList = this.$store.state.gameList
    }, 100)
  },
  methods: {
    goToNewPage(url) {
      if (url) {
        window.open(url, '_blank')
      }
    }
  }
}
</script>

<style lang="scss" scoped>
.account-on-sale-page {
  background: rgb(245, 245, 245);

  .nav-holder {
    width: 100%;
    height: 66px;
    background: #ffffff;
    border-bottom: 1px solid #E6E8EB;

    .nav-box {
      width: 1200px;
      height: 100%;
      margin: auto;

      .logo-box {
        width: 258px;
      }

      .switch-box {
        height: 100%;

        .item {
          margin-right: 60px;
          font-size: 18px;
          color: #3A3D41;
          cursor: pointer;
          line-height: 62px;
          a {
            color: #3A3D41;
          }

          &.active {
            font-weight: 500;
            border-bottom: 4px solid #F58B01;
          }
        }
      }

      .search-box {
        background: #EEEEEF;
        border-radius: 20px;
        height: 40px;
        padding: 4px;

        .select-box {
          width: 120px;
          height: 32px;
          border-radius: 16px;
          background: #FFFFFF;
          border: 1px solid #E6E8EB;
        }

        .input {
          padding: 0 12px;
          font-size: 14px;
          color: #8D9197;
          border: none;
          background: transparent;
          height: 100%;
          outline: none;
        }

        .search-btn {
          width: 32px;
          height: 32px;
          border-radius: 50%;
          cursor: pointer;

          img {
            width: 32px;
            height: 32px;
          }
        }
      }
    }
  }

  .breadcrumb-holder {
    width: 1200px;
    height: 62px;
    margin: auto;
    .item {
      font-weight: 500;
      font-size: 16px;
      color: #A6ACB3;
      cursor: pointer;
      &.active {
        color: #3A3D41;
      }
    }
    .arrow {
      margin: 0 10px;
      width: 16px;
      height: 16px;
    }
  }

  .sec-01 {
    width: 1200px;
    margin: auto;
    background: #ffffff;
    padding: 60px 80px 20px 80px;

    .item {
      display: inline-block;
      margin-right: 58px;
      width: 120px;
      cursor: pointer;
      margin-bottom: 40px;
      text-align: center;
      &:nth-child(6n) {
        margin-right: 0;
      }
      &:hover {
        .name {
          color: #F58B01;
          font-weight: 500;
        }
      }
      img {
        width: 100px;
        height: 100px;
        border-radius: 12px;
      }
      .name {
        font-size: 14px;
        color: #3A3D41;
        text-align: center;
        line-height: 20px;
        margin-top: 12px;
      }
    }
  }
}
</style>
